﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:digitizer="clr-namespace:DeepEarth.Toolkit.Controls"
    >
    
        <!--Style ToggleButton -->
    <Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid RenderTransformOrigin="0.5,0.5" x:Name="grid">
                        <Grid.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </Grid.RenderTransform>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.75"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="disabled" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.3000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.85"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.85"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFA5A5A5"/>
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFC2C2C2"/>
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF333333"/>
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.996"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.12"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="background" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Stroke="#BF2D2D2D" StrokeThickness="1" RadiusX="3" RadiusY="3" Opacity="0.5" x:Name="background">
                            <Rectangle.Fill>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.201" ScaleY="1.201"/>
                                            <SkewTransform CenterX="0.5" CenterY="0.5"/>
                                            <RotateTransform CenterX="0.5" CenterY="0.5"/>
                                            <TranslateTransform X="0.026" Y="0.01"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FF414141"/>
                                    <GradientStop Color="#FF121212" Offset="1"/>
                                    <GradientStop Color="#FF000000" Offset="0.929"/>
                                </RadialGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Height="10.013" HorizontalAlignment="Stretch" Margin="1.43400001525879,1.4099999666214,1.44599997997284,0" VerticalAlignment="Top" StrokeThickness="0" RadiusX="2.714" RadiusY="2.714" Opacity="0.31" x:Name="glow">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#7FFFFFFF" Offset="0.567"/>
                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Height="10.013" HorizontalAlignment="Stretch" Margin="1.43400001525879,1.4099999666214,1.44599997997284,0" VerticalAlignment="Top" StrokeThickness="0" RadiusX="2.714" RadiusY="2.714" Opacity="0.31" x:Name="disabled">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#7FFFFFFF" Offset="0.567"/>
                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,3,8,3"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="digitizer:DrawingTool">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="digitizer:DrawingTool">
                    <StackPanel Orientation="{TemplateBinding Orientation}">
                        <ToggleButton x:Name="PART_pointButton" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" ToolTipService.ToolTip="Add Pushpin">
                            <Image Source="/DeepEarth.Toolkit.Controls.DrawingTool;component/Images/pin.png"></Image>
                        </ToggleButton>
                        <ToggleButton x:Name="PART_lineButton" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" ToolTipService.ToolTip="Draw Line">
                            <Image Source="/DeepEarth.Toolkit.Controls.DrawingTool;component/Images/draw.png"></Image>
                        </ToggleButton>
                        <ToggleButton x:Name="PART_polygonButton" Width="40" Height="40"  Style="{StaticResource ToggleButtonStyle}" ToolTipService.ToolTip="Draw Polygon">
                            <Image Source="/DeepEarth.Toolkit.Controls.DrawingTool;component/Images/polygon.png"></Image>
                        </ToggleButton>
                        <ToggleButton x:Name="PART_freeDrawButton" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" ToolTipService.ToolTip="Free Draw">
                            <Image Source="/DeepEarth.Toolkit.Controls.DrawingTool;component/Images/line.png"></Image>
                        </ToggleButton>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



</ResourceDictionary>
